'use strict';

import React, { Component } from 'react';

import {
  StyleSheet,
  View,
} from 'react-native';

import path from 'react-native-path';
import fs from 'react-native-fs'
import {NavigationBar} from 'react-native-navigator'
import Manager from 'react-native-download-manager'

class DownloadManager extends Component {
  constructor(props) {
    super(props);
  
    this.state = {};

    Manager.download('http://www.baidu.com').to(path.resolve(fs.HOME, 'www.baidu.com.html'));
  }
  render() {
    return (
      <View style={styles.container}>
        <NavigationBar navigator={this.props.navigator} title='DownloadManager'/>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    backgroundColor: '#F5FCFF'
  }
});


export default DownloadManager;